package Test;

public class Demo02_TestOperator {
    public static void main(String[] args) {
        //赋值运算符
        byte b = 10;
        b = 20;
        //b = b + 1; //error  int可以，其他的不行  精度缺失
        b = (byte)(b + 1);
        b += 1; //默认会进行强转
        System.out.println(b);

        //自增自减
        //i++ 先参与 i 计算 再进行加一
        //++i 先加一再参与其他计算
        int x = 15 ;
        int y = x ++ ;
        System.out.println("x = " + x + ", y = " + y);  //x = 16, y = 15

        int x1 = 15 ;
        int y1 =  ++ x1;
        System.out.println("x1 = " + x1 + ", y1 = " + y1);  //x1 = 16, y1 = 16

        x = 22 ;
        x = x ++ ;
        System.out.println("x :" + x);
    }
}
